package com.demo.component;

import com.demo.model.Student;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;

@Controller
public class StudentBean {

    @Bean(name = {"s1","s2"})
    public Student student() {
        Student student = new Student();
        student.setId(1);
        student.setName("张三");
        student.setAge(17);
        return student;
    }
}
